package com.xxx.hhh.demo.demo4;

import java.io.IOException;
import java.net.*;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket();
       String s = "少时诵诗书";
        byte[] bytes = s.getBytes();
        InetAddress byName = InetAddress.getByName("127.0.0.1");
        int port = 12345;
        DatagramPacket dp = new DatagramPacket(bytes,bytes.length,byName,port);
        ds.send(dp);
        ds.close();
    }
}
